Labor of Division (Episode III): Faster Unsigned Division by Constants
ثبت نشده
چکیده
As is well known (and seen in a previous post), compilers optimize unsigned division by constants into multiplication by a "magic number." But not all constants are created equal, and approximately 30% of divisors require magic numbers that are one bit too large, which necessitates special handling (read: are slower). Of these 30%, slightly less than half (46%) are even, which can be handled at a minimum of increased expense (see below); the remaining odd divisors (659 million, including well known celebrity divisors like 7) need a relatively expensive "fixup" after the multiplication. Or so we used to think. This post gives a variation on the usual algorithm that improves performance for these expensive divisors.
منابع مشابه
Efficient Algorithms for Integer Division by Constants Using Multiplication
We present a complete analysis of the integer division of a single unsigned dividend word by a single unsigned divisor word based on double-word multiplication of the dividend by an inverse of the divisor. The well-known advantage of this method yields run-time efficiency, if the inverse of the divisor can be calculated at compile time, since multiplication is much faster than division in arith...
متن کاملDivision of Labor and Structuration Theory: A Comparative and Theoretical Analysis of Marx’s and Durkheim’s Theories as the Early Approaches to Structuration Theory
To the extent that a society is to work, there exist a need for a cooperative process, including Weber’s and Merton’s note of common means and goals. But at the same time, there exist no societal process without involving conflict; (conflict in a dynamic and dialectical sense.) Dealing with this problematic situation the emergence of “division of labor”, as a compulsive social differentiation, ...
متن کاملThe Relationship Between Gender-Role Beliefs, Household Labor Division and Marital Satisfaction in Couples
Introduction: Marital satisfaction is important for several reasons, including individual and mental health of the husband, wife and children. One of the main factors in marital satisfaction is the division of household tasks, which varies according to the gender-role beliefs of the couples. Objective: This study aims to examine the association between marital satisfaction, division of househ...
متن کاملThe Relationship of Gender Role Attitude and Division of Household labor with Couples' Perceived justice
Background & aim: Given the advancements in science, technology, and cultural globalization, Iranian families has changed in several aspects affecting individual’s perception of justice in division of household labor. Therefore, we sought to evaluate the correlation of gender role attitude and household labor division with perceived justice in couples. Methods: The present correlational study w...
متن کاملSoftware Integer Division
Early computers omitted instructions for integer multiplication and division, requiring these operations to be synthesized in software. Even some modern RISC and DSP architectures are deficient in the case of division. Therefore software methods for performing integer division continue to be of interest. We consider typical architectures based on two’s complement binary arithmetic and present v...
متن کامل